package me.sunpeng.principle.singleresponsibility;

/**
 * @author sp
 * @create 2022-03-09
 */
public class SingleResponsibility2 {
    public static void main(String[] args) {

    }
}
//方案二的分析
//1.遵守单一职责原则
//2.改动很大，即将类分解，同时修改客户端
//3.改进：直接修改Vehicle类，方案三
class RoadVehicle {
    public void run(String vehicle) {
        System.out.println(vehicle + "在公路运行");
    }
}

class AirVehicle {
    public void run(String vehicle) {
        System.out.println(vehicle + "天空运行");
    }
}